// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using SqlSugar;
using System.ComponentModel.DataAnnotations;
namespace Admin.NET.Application.Entity;

/// <summary>
/// 区域预算配置表
/// </summary>
[Tenant("1300000000001")]
[SugarTable("store_BudgetConfig", "区域预算配置表")]
public partial class StoreBudgetConfig : EntityBaseTenantDel
{
    /// <summary>
    /// 区域/组织ID
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "OrgsId", ColumnDescription = "区域ID")]
    public virtual long OrgsId { get; set; }


    /// <summary>
    /// 预算开始时间
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "StartDate", ColumnDescription = "预算开始时间")]
    public virtual DateTime StartDate { get; set; }
    
    /// <summary>
    /// 预算结束时间
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "EndDate", ColumnDescription = "预算结束时间")]
    public virtual DateTime EndDate { get; set; }
    
    /// <summary>
    /// 总预算额度
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "TotalAmount", ColumnDescription = "总预算额度")]
    public virtual decimal TotalAmount { get; set; }
    
    /// <summary>
    /// 已使用额度（自动计算）
    /// </summary>
    [SugarColumn(ColumnName = "UsedAmount", ColumnDescription = "已使用额度")]
    public virtual decimal UsedAmount { get; set; } = 0;
    
    /// <summary>
    /// 申请中额度（自动计算）
    /// </summary>
    [SugarColumn(ColumnName = "PendingAmount", ColumnDescription = "申请中额度")]
    public virtual decimal PendingAmount { get; set; } = 0;
    
    /// <summary>
    /// 预警阈值（百分比，如80表示80%）
    /// </summary>
    [SugarColumn(ColumnName = "WarningThreshold", ColumnDescription = "预警阈值")]
    public virtual decimal WarningThreshold { get; set; } = 80;
    
    /// <summary>
    /// 预算名称/描述
    /// </summary>
    [SugarColumn(ColumnName = "BudgetName", ColumnDescription = "预算名称", Length = 128)]
    public virtual string? BudgetName { get; set; }
    
    /// <summary>
    /// 是否启用预警
    /// </summary>
    [SugarColumn(ColumnName = "IsWarningEnabled", ColumnDescription = "是否启用预警")]
    public virtual bool IsWarningEnabled { get; set; } = true;
    
    /// <summary>
    /// 备注
    /// </summary>
    [SugarColumn(ColumnName = "Remark", ColumnDescription = "备注", Length = 256)]
    public virtual string? Remark { get; set; }
}